home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / cattool / lbl420.zip / LABELER.PAS < prev    next >
Pascal/Delphi Source File  |  1989-12-17  |  50KB  |  1,458 lines

  1. {                                                                             }
  2. {                                                                             }
  3. {    Program     LABELER                                                      }
  4. {                                                                             }
  5. {    Author      Ken Buetow             CIS [71001,613]                       }
  6. {                Guardian Software                                            }
  7. {                26 Rose Street                                               }
  8. {                Baltic, Ct  06330-1028                                       }
  9. {                                                                             }
  10. {    Phone       (203) 822-9212 [Voice]                                       }
  11. {                                                                             }
  12. {    Date        February 1, 1986       Last revised  July 20, 1989           }
  13. {                                                                             }
  14. {    Language    TURBO Pascal version 5                                       }
  15. {                                                                             }
  16. {    Remarks                                                                  }
  17. {                                                                             }
  18. {                Utility to print disk labels on standard size                }
  19. {                one-up labels.                                               }
  20. {                                                                             }
  21. {                Portions (c) Borland International                           }
  22.  
  23. {$V-}
  24. {$S+}    {Stack checking on}
  25. {$I+}    {I/O checking on}
  26. {$N-}    {No numeric coprocessor}
  27.  
  28. program labeler;
  29.  
  30.  
  31. Uses
  32.   Crt,
  33.   Dos;
  34.  
  35. const
  36.   version   = '4.20';
  37.   double    = '═══════════════════════════════════════════════════════════════════════════════';
  38.   single    = '───────────────────────────────────────────────────────────────────────────────';
  39.   long      = '----------------------------------------------------------------';
  40.   max_files = 4096;
  41.   init_str     :string = ^N^R^T^['F'^['H'^['T'^['9'^['2';
  42.   line_spacing :string = #27'3'#18;
  43.   sub_on       :string = #27'S'#0;
  44.   sub_off      :string = #27'T';
  45.   emp_on       :string = #27'E';
  46.   emp_off      :string = #27'F';
  47.   dbl_on       :string = #14;
  48.   dbl_off      :string = #20;
  49.   cond_on      :string = #15;
  50.   cond_off     :string = #18;
  51.   dbl_st_on    :string = #27'G';
  52.   dbl_st_off   :string = #27'H';
  53.  
  54.   type_over : boolean = true;
  55.   registered: boolean = false;
  56.   labels = 10;
  57.  
  58. type
  59.   str_10 = string[10];
  60.   str_12 = string[13];
  61.   str_45 = string[65];
  62.   cmt_ptr= ^str_45;
  63.   fs_ptr = ^str_12;
  64.  
  65. var
  66.   test:integer;
  67.   lst,
  68.   cnf_file  :text;
  69.   key       :char;
  70.   reg       :registers;
  71.   max_drive,
  72.   drive,
  73.   curr_dr   :byte;
  74.   d_size,
  75.   used,
  76.   free      :LongInt;
  77.   copies,
  78.   i,j,k,x,y,
  79.   count,
  80.   start,
  81.   printer,
  82.   num_files :integer;
  83.   temp_str,
  84.   disk_name,
  85.   library,
  86.   line,
  87.   mask_fs   :string[255];
  88.   mask_file :text;
  89.   temp,
  90.   spaces,
  91.   blank_fs  :str_12;
  92.   blank_cmt :str_45;
  93.   temp_fs   :fs_ptr;
  94.   temp_cmt  :cmt_ptr;
  95.   filespec  :array[1..max_files] of record
  96.                                       name:fs_ptr;
  97.                                       cmt:cmt_ptr
  98.                                     end;
  99.   cont,
  100.   again,
  101.   abort,
  102.   blank     :boolean;
  103.   s_rec     :SearchRec;
  104.   size,
  105.   sizes     :byte;
  106.   tcols     :integer;
  107.   label_size:array[0..labels] of string;
  108.   wrap      :array[0..labels] of boolean;
  109.   cols      :array[0..labels] of integer;
  110.   rows      :array[0..labels] of integer;
  111.   filler    :array[0..labels] of integer;
  112.   feeds     :array[0..labels] of integer;
  113.   dbl       :array[0..labels] of boolean;
  114.   width     :array[0..labels] of integer;
  115.   path      :string;
  116.  
  117.  
  118. function value(s:string):integer;
  119. var i,c:integer;
  120. begin
  121.   val(s,i,c);
  122.   value := i
  123. end;
  124.  
  125. function parse(s:string):string;
  126. var st:string;
  127. begin
  128.   st := '';
  129.   while s[1] in ['0'..'9'] do
  130.     begin
  131.       st := st + chr(value(copy(s,1,pos(' ',s)-1)));
  132.       s := copy(s,pos(' ',s)+1,255)
  133.     end;
  134.   parse := st
  135. end;
  136.  
  137.  
  138. function Flop(c:char):string;
  139. begin
  140.   case ord(c) of
  141.       0: flop := #27#76#9#0#0#0#0#0#0#0#0#0#0;
  142.       1: flop := #27#76#9#0#60#66#149#177#177#149#66#60#0;
  143.       2: flop := #27#76#9#0#60#126#235#207#207#235#126#60#0;
  144.       3: flop := #27#76#9#0#0#14#31#62#124#62#31#14#0;
  145.       4: flop := #27#76#9#0#0#8#28#62#127#62#28#8#0;
  146.       5: flop := #27#76#9#0#28#28#74#127#127#74#28#28#0;
  147.       6: flop := #27#76#9#0#8#28#94#127#127#94#28#8#0;
  148.       7: flop := #27#76#9#0#0#0#60#60#60#60#0#0#0;
  149.       8: flop := #27#76#9#0#255#255#195#195#195#195#255#255#0;
  150.       9: flop := #27#76#9#0#0#126#66#66#66#66#126#0#0;
  151.      10: flop := #27#76#9#0#255#129#189#189#189#189#129#255#0;
  152.      11: flop := #27#76#9#0#15#7#127#249#136#136#248#112#0;
  153.      12: flop := #27#76#9#0#0#0#78#95#241#241#95#78#0;
  154.      13: flop := #27#76#9#0#7#7#5#5#127#254#224#192#0;
  155.      14: flop := #27#76#9#0#63#127#101#5#5#127#254#192#0;
  156.      15: flop := #27#76#9#0#219#219#60#231#231#60#219#219#0;
  157.      16: flop := #27#76#9#0#0#8#8#28#62#62#127#127#0;
  158.      17: flop := #27#76#9#0#0#127#127#62#62#28#8#8#0;
  159.      18: flop := #27#76#9#0#0#0#36#102#255#255#102#36#0;
  160.      19: flop := #27#76#9#0#0#0#95#95#0#95#95#0#0;
  161.      20: flop := #27#76#9#0#127#127#1#127#127#17#31#14#0;
  162.      21: flop := #27#76#9#0#0#88#253#165#165#191#26#0#0;
  163.      22: flop := #27#76#9#0#0#112#112#112#112#112#112#112#0;
  164.      23: flop := #27#76#9#0#0#148#182#255#255#182#148#0#0;
  165.      24: flop := #27#76#9#0#0#0#4#6#127#127#6#4#0;
  166.      25: flop := #27#76#9#0#0#0#16#48#127#127#48#16#0;
  167.      26: flop := #27#76#9#0#0#8#28#62#8#8#8#8#0;
  168.      27: flop := #27#76#9#0#0#8#8#8#8#62#28#8#0;
  169.      28: flop := #27#76#9#0#0#16#16#16#16#16#28#28#0;
  170.      29: flop := #27#76#9#0#8#28#42#8#8#42#28#8#0;
  171.      30: flop := #27#76#9#0#0#48#56#60#62#60#56#48#0;
  172.      31: flop := #27#76#9#0#0#6#14#30#62#30#14#6#0;
  173.      32: flop := #27#76#9#0#0#0#0#0#0#0#0#0#0;
  174.      33: flop := #27#76#9#0#0#0#0#95#95#0#0#0#0;
  175.      34: flop := #27#76#9#0#0#0#7#7#0#0#7#7#0;
  176.      35: flop := #27#76#9#0#0#21#63#126#85#63#126#84#0;
  177.      36: flop := #27#76#9#0#0#18#58#43#107#106#46#36#0;
  178.      37: flop := #27#76#9#0#0#99#102#12#24#48#99#67#0;
  179.      38: flop := #27#76#9#0#0#80#114#55#93#79#122#48#0;
  180.      39: flop := #27#76#9#0#0#0#0#0#3#7#4#0#0;
  181.      40: flop := #27#76#9#0#0#0#65#99#62#28#0#0#0;
  182.      41: flop := #27#76#9#0#0#0#28#62#99#65#0#0#0;
  183.      42: flop := #27#76#9#0#0#8#42#62#28#62#42#8#0;
  184.      43: flop := #27#76#9#0#0#8#8#62#62#8#8#0#0;
  185.      44: flop := #27#76#9#0#0#0#0#96#224#128#0#0#0;
  186.      45: flop := #27#76#9#0#0#8#8#8#8#8#8#0#0;
  187.      46: flop := #27#76#9#0#0#0#0#96#96#0#0#0#0;
  188.      47: flop := #27#76#9#0#0#3#6#12#24#48#96#64#0;
  189.      48: flop := #27#76#9#0#0#62#127#71#77#89#127#62#0;
  190.      49: flop := #27#76#9#0#0#64#64#127#127#66#64#0#0;
  191.      50: flop := #27#76#9#0#0#102#111#73#89#81#115#98#0;
  192.      51: flop := #27#76#9#0#0#54#127#73#73#65#99#34#0;
  193.      52: flop := #27#76#9#0#0#16#127#127#19#22#28#24#0;
  194.      53: flop := #27#76#9#0#0#57#125#69#69#69#103#39#0;
  195.      54: flop := #27#76#9#0#0#48#121#73#73#75#126#60#0;
  196.      55: flop := #27#76#9#0#0#3#7#13#121#113#3#3#0;
  197.      56: flop := #27#76#9#0#0#54#127#73#73#73#127#54#0;
  198.      57: flop := #27#76#9#0#0#30#63#105#73#73#79#6#0;
  199.      58: flop := #27#76#9#0#0#0#0#102#102#0#0#0#0;
  200.      59: flop := #27#76#9#0#0#0#0#102#230#128#0#0#0;
  201.      60: flop := #27#76#9#0#0#0#65#99#54#28#8#0#0;
  202.      61: flop := #27#76#9#0#0#36#36#36#36#36#36#0#0;
  203.      62: flop := #27#76#9#0#0#8#28#54#99#65#0#0#0;
  204.      63: flop := #27#76#9#0#0#6#15#89#81#3#2#0#0;
  205.      64: flop := #27#76#9#0#0#30#95#93#93#65#127#62#0;
  206.      65: flop := #27#76#9#0#0#124#126#19#17#19#126#124#0;
  207.      66: flop := #27#76#9#0#0#54#127#107#73#127#127#65#0;
  208.      67: flop := #27#76#9#0#0#99#65#65#65#99#62#28#0;
  209.      68: flop := #27#76#9#0#0#62#62#99#65#127#127#65#0;
  210.      69: flop := #27#76#9#0#0#99#6